<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Read an overview of the information in the headers of the given message</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.imap-expunge.html">« imap_expunge</a></li>
      <li style="float: right;"><a href="function.imap-fetchbody.html">imap_fetchbody »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.imap.html">IMAP 函数</a></li>
    <li>Read an overview of the information in the headers of the given message</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.imap-fetch-overview" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imap_fetch_overview</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imap_fetch_overview</span> &mdash; <span class="dc-title">Read an overview of the information in the headers of the given message</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imap-fetch-overview-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imap_fetch_overview</strong></span>(<span class="methodparam"><span class="type"><span class="type IMAP\Connection">IMAP\Connection</span></span> <code class="parameter">$imap</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$sequence</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = 0</span></span>): <span class="type"><span class="type">array</span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   This function fetches mail headers for the given
   <code class="parameter">sequence</code> and returns an overview of their
   contents.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imap-fetch-overview-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    <dt>

<code class="parameter">imap</code></dt>
<dd>
<p class="para"><span class="classname"><strong class="classname">IMAP\Connection</strong></span> 实例。</p></dd>

    
     <dt>
<code class="parameter">sequence</code></dt>

     <dd>

      <p class="para">
       A message sequence description. You can enumerate desired messages
       with the <code class="literal">X,Y</code> syntax, or retrieve all messages 
       within an interval with the <code class="literal">X:Y</code> syntax
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">flags</code></dt>

     <dd>

      <p class="para">
       <code class="parameter">sequence</code> will contain a sequence of message
       indices or UIDs, if this parameter is set to 
       <strong><code>FT_UID</code></strong>. 
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imap-fetch-overview-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns an array of objects describing one message header each.
   The object will only define a property if it exists. The possible
   properties are:
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      <code class="literal">subject</code> - the messages subject
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">from</code> - who sent it
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">to</code> - recipient
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">date</code> - when was it sent
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">message_id</code> - Message-ID
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">references</code> - is a reference to this message id
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">in_reply_to</code> - is a reply to this message id
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">size</code> - size in bytes
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">uid</code> - UID the message has in the mailbox
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">msgno</code> - message sequence number in the mailbox
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">recent</code> - this message is flagged as recent
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">flagged</code> -  this message is flagged
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">answered</code> -  this message is flagged as answered
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">deleted</code> -  this message is flagged for deletion
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">seen</code> -  this message is flagged as already read
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">draft</code> -  this message is flagged as being a draft
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <code class="literal">udate</code> -  the UNIX timestamp of the arrival date
     </span>
    </li>
   </ul>
   The function returns <strong><code>false</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imap-fetch-overview-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  现在 <code class="parameter">imap</code> 参数接受 <span class="classname"><strong class="classname">IMAP\Connection</strong></span>
  实例，之前接受 <a href="language.types.resource.html" class="link">资源(resource)</a>。
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imap-fetch-overview-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2987">
    <p><strong>示例 #1 <span class="function"><strong>imap_fetch_overview()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$mbox&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imap_open</span><span style="color: #007700">(</span><span style="color: #DD0000">"{imap.example.org:143}INBOX"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;die(</span><span style="color: #DD0000">"can't&nbsp;connect:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">imap_last_error</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">$MC&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imap_check</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Fetch&nbsp;an&nbsp;overview&nbsp;for&nbsp;all&nbsp;messages&nbsp;in&nbsp;INBOX<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imap_fetch_overview</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">,</span><span style="color: #DD0000">"1:</span><span style="color: #007700">{</span><span style="color: #0000BB">$MC</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Nmsgs</span><span style="color: #007700">}</span><span style="color: #DD0000">"</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br />foreach&nbsp;(</span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$overview</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"#</span><span style="color: #007700">{</span><span style="color: #0000BB">$overview</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">msgno</span><span style="color: #007700">}</span><span style="color: #DD0000">&nbsp;(</span><span style="color: #007700">{</span><span style="color: #0000BB">$overview</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">date</span><span style="color: #007700">}</span><span style="color: #DD0000">)&nbsp;-&nbsp;From:&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">$overview</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">from</span><span style="color: #007700">}</span><span style="color: #DD0000"><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">$overview</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">subject</span><span style="color: #007700">}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">imap_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.imap-fetch-overview-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.imap-fetchheader.html" class="function" rel="rdfs-seeAlso">imap_fetchheader()</a> - Returns header for a message</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>